package com.ynet.middleground.contract.bean;

import java.io.Serializable;
import java.util.Map;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author daigaole
 * @description 新建合约请求
 * @date 2020-03-18
 */
@Data
@ApiModel(value = "确认提交新建合约请求对象", description = "确认提交新建合约请求对象")
public class NewContract implements Serializable {

    private static final long serialVersionUID = -6529789035413938942L;

    /* 调整的需求 begin */
    /**
     * 模板id
     */
    @ApiModelProperty(value = "需要根据模版生成合约或档案时，模板id(必填)", notes = "需要根据模版生成合约或档案时，模板id(必填)", dataType = "Integer")
    private Integer templateId;

    /**
     * 签署方式：0-线上，1-线下
     */
    @ApiModelProperty(value = "如果是生成合约，签署方式（0-线上，1-线下）必填", notes = "如果是生成合约，签署方式（0-线上，1-线下）必填", dataType = "String")
    @Size(max = 1, min = 1, message = "长度为1")
    @Pattern(regexp = "[01]", message = "签署方式：0-线上，1-线下")
    private String signedWay;

    /**
     * 上级合约id
     */
    @ApiModelProperty(value = "生成下级合约时，上级合约id", notes = "生成下级合约时，上级合约id", dataType = "Integer")
    private Integer parentId;

    /**
     * 描述备注
     */
    @ApiModelProperty(value = "描述备注", notes = "描述备注", dataType = "String")
    private String description;

    /**
     * 合约名称/模版名称
     */
    @ApiModelProperty(value = "合约名称", notes = "合约名称", required = true, dataType = "String")
    @NotBlank(message = "合约名称/模版名称不能为空")
    private String name;

    /**
     * 渠道端业务id
     */
    @ApiModelProperty(value = "渠道端业务id", notes = "渠道端业务id", required = true, dataType = "String")
    @NotBlank(message = "渠道端业务id不能为空")
    private String busId;

    /**
     * 参数
     */
    @ApiModelProperty(value = "模版渲染参数，所有的key值都是模版参数的name值", notes = "模版渲染参数，所有的key值都是模版参数的name值",
        dataType = "java.util.Map")
    private Map<String, Object> parameter;

    /**
     * 非制式合约内容（oss地址）
     */
    @ApiModelProperty(value = "如果是生成非制式合约，非制式合约文件地址必填\n短路径地址(包含 Bucket) \n  如：zhongtai/file.pdf",
        notes = "如果是生成非制式合约，非制式合约文件地址必填\n短路径地址(包含 Bucket) \n  如：zhongtai/file.pdf", dataType = "String")
    private String nonStandardContractOss;

    /**
     * 非制式二维码key
     */
    @ApiModelProperty(value = "如果是生成非制式合约，非制式二维码key必填", notes = "如果是生成非制式合约，非制式二维码key必填", dataType = "String")
    private String codeQrKey;

    /**
     * 非制式合约编号占位符key
     */
    @ApiModelProperty(value = "如果是生成非制式合约，合约编号占位符key必填", notes = "如果是生成非制式合约，合约编号占位符key必填", dataType = "String")
    private String placeholderKey;

    /**
     * 产品类型
     */
    @ApiModelProperty(value = "产品类型", notes = "产品类型", dataType = "String")
    @NotBlank(message = "产品类型不能为空")
    private String productType;

    /**
     * 签署方名称
     */
    @ApiModelProperty(value = "如果是生成合约，签署方名称必填", notes = "如果是生成合约，签署方名称必填", dataType = "String")
    private String signatoryName;

    /**
     * 合约类型Code
     */
    @ApiModelProperty(value = "合约类型Code，非制式必填", notes = "合约类型Code，非制式必填", required = true, dataType = "String")
    private String contractTypeCode;
    /* 调整的需求 end */

}
